<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <link href="./css/taggd.css" rel="stylesheet">
    <link href="./css/taggd-classic.css" rel="stylesheet">
    <link href="./layui/css/layui.css" rel="stylesheet">
    <script src="js/jquery-1.11.0.min.js"></script>
    <script src="./layui/layui.js"></script>
    <script src="./js/functions.js"></script>
    <script src="./js/taggd.umd.js"></script>
    <script src="js/demo.js"></script>
    <script src="./js/html2canvas.min.js"></script>
    <title>Document</title>
    <style>
        .didian {
            background-image: url('./img/1121.png');
        }

        .imgH {
            width: 100%;
            height: 600px;
        }
        .name_cont{
            width: 90%;
            margin: 0 auto;
            padding: 5px 0;
        }
        /*滚动条样式*/
        ::-webkit-scrollbar {/*滚动条整体样式*/
            width: 4px;     /*高宽分别对应横竖滚动条的尺寸*/
            height: 4px;
        }
        ::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
            background: rgba(0,0,0,0.2);
        }
        ::-webkit-scrollbar-track {/*滚动条里面轨道*/
            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
            border-radius: 0;
            background: rgba(0,0,0,0.1);
        }
        .listclick{
            cursor: pointer;
        }
        .input-block{
            margin-right: 5px;
        }
    </style>
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row" id="loadpic">
        <div class="layui-col-sm2">
            <form class="layui-form" action="">
                <div class="name_cont" >
                    <input type="radio" name="sex" value="wifi" title="wifi" lay-filter="demoRadio">
                    <input type="radio" name="sex" value="定位卡" title="定位卡" checked lay-filter="demoRadio">
                    <input type="radio" name="sex" value="人脸识别" title="人脸识别" lay-filter="demoRadio">
                </div>
                <div class="input-block">
                    <input type="text" name="title" placeholder="请输入标题" class="layui-input" id="inputDiv">
                </div>
            </form>
            <hr class="layui-border-green">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li class="layui-this" lay-id="11">全部人员</li>
                    <li lay-id="22">重点场所</li>
                    <li lay-id="33">重点人员</li>
                </ul>
                <div class="layui-tab-content" style="height: 425px;overflow-y: auto">

                    <div class="layui-tab-item layui-show" id="alldata">

                    </div>
                    <div class="layui-tab-item">内容2</div>
                    <div class="layui-tab-item">内容3</div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm10">
            <div class="imgH">
                <img alt="" id="my-image" src="./img/红岭八中段.png" style="width: 100%;height: 100%;"/>
            </div>
        </div>
        <button id="picbtn">点我保存为图片</button>
    </div>

</div>
</body>
<script>
    $("#picbtn").on("click",function(){
        html2canvas(document.querySelector("#loadpic")).then(canvas => {
            document.body.appendChild(canvas)
            var imgUrl = canvas.toDataURL("image/png"); // 将canvas转换成img的src流
            console.log("base64编码数据：", imgUrl);
        });
    })
</script>
</html>